package com.soilflow.web.controller.reception;

import com.soilflow.common.core.domain.AjaxResult;
import com.soilflow.common.core.page.TableDataInfo;
import com.soilflow.common.domain.ColorfulUser;
import com.soilflow.common.domain.SysArticle;
import com.soilflow.common.domain.dto.SysArticleDto;
import com.soilflow.system.service.IColorfulUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.soilflow.common.core.domain.AjaxResult.success;
import static com.soilflow.common.utils.PageUtils.startPage;

@RequestMapping("/colorfulUsers")
@RestController
public class ColorfulUserController {
    @Autowired
    private IColorfulUserService colorfulUserService;

    @GetMapping("/list")
    public List<ColorfulUser> selectarticle(){
        List<ColorfulUser> list = colorfulUserService.list();
        System.out.println("list.size() = " + list.size());
        return list;
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody ColorfulUser user)
    {
        colorfulUserService.save(user);
        return success();
    }
}
